<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/7/1
  Time: 9:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$</title>
    <link rel="stylesheet" href="css/css.css">
    <script src="js/jquery-1.8.2.min.js"></script>
    <script>
        function fenye(pages) {
            $("[name='pages']").val(pages);
            $("form").submit();
        }
    </script>
</head>
<body>
<form action="/list.do" method="post">
    价格范围:<input type="text" name="startp" value="${map.startp}">-
    <input type="text" name="endp" value="${map.endp}">元
    已售百分比:<input type="text" name="starts" value="${map.starts}">-
    <input type="text" name="ends" value="${map.ends}">
    <input type="submit" value="查询">
</form>
<table>
    <tr>
        <td>主键</td>
        <td>商品名称</td>
        <td>商品价格</td>
        <td>已售百分比</td>
    </tr>
    <c:forEach items="${pageInfo.list}" var="g">
        <tr>
            <td>${g.id}</td>
            <td>${g.name}</td>
            <td>${g.price}</td>
            <td>${g.sales}</td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="10">
            <input type="button" class="btn btn-info" value="首页" onclick="fenye(1)">
            <input type="button" class="btn btn-info" value="上一页" onclick="fenye(${pageInfo.isFirstPage?1:pageInfo.prePage})">
            <input type="button" class="btn btn-info" value="下一页" onclick="fenye(${pageInfo.isLastPage?pageInfo.pages:pageInfo.nextPage})">
            <input type="button" class="btn btn-info" value="尾页" onclick="fenye(${pageInfo.pages})">
        </td>
    </tr>
</table>
</body>
</html>
